<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8" />
	<title>面向研究团队的参考文献管理与服务分布式系统</title>
	<meta name="keywords" content="面向研究团队的参考文献管理与服务分布式系统" />
	<meta name="description" content="面向研究团队的参考文献管理与服务分布式系统" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<link href="../css/bootstrap.min.css" rel="stylesheet" />
	<link href="../css/bootstrap-table.css" rel="stylesheet" />
	<link href="../css/bootstrap-editable.css" rel="stylesheet" />
	<link rel="stylesheet" href="../css/font-awesome.min.css" />

	<link rel="stylesheet" href="../css/ace.min.css" />
	<link rel="stylesheet" href="../css/ace-rtl.min.css" />
	<link rel="stylesheet" href="../css/ace-skins.min.css" />
	<link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css">
	<link href="../css/jquery-confirm.min.css" rel="stylesheet">

	<!--<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />-->

	<!--主要样式-->
	<link rel="stylesheet" type="text/css" href="../css/style1.css" />

	<script src="../js/ace-extra.min.js"></script>
	<script src="../js/angular.min.js"></script>
	<script src="../js/angular-cookies.min.js"></script>

	<style type="text/css">
		.shade{
			width:100%;
			height: 100%;
			position: absolute;
			top: 0px;
			left: 0px;

		}
		.wrap-ms-right{
			list-style: none;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 9999;
			padding: 5px 0;
			min-width: 80px;
			margin: 0;
			display: none;
			font-family: "微软雅黑";
			font-size: 14px;
			background-color: #fff;
			border: 1px solid rgba(0, 0, 0, .15);
			box-sizing: border-box;
			border-radius: 4px;
			-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
			-moz-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
			-ms-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
			-o-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
			box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
		}
		.ms-item{
			height: 30px;
			line-height: 30px;
			text-align: center;
			cursor: pointer;
		}
		.ms-item:hover{
			background-color: #343a40;
			color: #FFFFFF;
		}
		.m{width: 800px;
			margin-left: auto;
			margin-right: auto;
		}
	</style>

</head>

<body>

<div class="navbar navbar-default" id="navbar">
	<script type="text/javascript">
		try {
			ace.settings.check('navbar', 'fixed')
		} catch(e) {}
	</script>
	<div class="navbar-container" id="navbar-container">
		<div class="navbar-header pull-left">
			<a href="#" class="navbar-brand">
				<small>
					<i class="icon-book"></i>

					面向研究团队的参考文献管理与服务分布式系统
				</small>
			</a>
			<!-- /.brand -->
		</div>
		<!-- /.navbar-header -->

		<div class="navbar-header pull-right" role="navigation">
			<ul class="nav ace-nav">

				<li class="light-blue">
					<a data-toggle="dropdown" href="#" class="dropdown-toggle">
						<img class="nav-user-photo" src="../avatars/user.jpg" alt="Jason's Photo" />
						<span class="user-info">
									<small>欢迎,</small>
									登录
								</span>

						<i class="icon-caret-down"></i>
					</a>

					<ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
						<li>
							<a href="#">
								<i class="icon-cog"></i> 设置
							</a>
						</li>

						<li>
							<a href="#">
								<i class="icon-user"></i> 简况
							</a>
						</li>

						<li class="divider"></li>

						<li>
							<a href="/ma/user/logout"  class="a_post">
								<i class="icon-off"></i> 登出
							</a>
						</li>
					</ul>
				</li>
			</ul>
			<!-- /.ace-nav -->
		</div>
		<!-- /.navbar-header -->
	</div>
	<!-- /.container -->

</div>

<div class="main-container" id="main-container">
	<script type="text/javascript">
		try {
			ace.settings.check('main-container', 'fixed')
		} catch(e) {}
	</script>

	<div class="main-container-inner">
		<a class="menu-toggler" id="menu-toggler" href="#">
			<span class="menu-text"></span>
		</a>

		<div class="sidebar" id="sidebar">
			<script type="text/javascript">
				try {
					ace.settings.check('sidebar', 'fixed')
				} catch(e) {}
			</script>

			<!-- #sidebar-shortcuts -->
			<ul class="nav nav-list">
				<li>
					<a href="#" class="dropdown-toggle">
						<i class="icon-book"></i>
						<span class="menu-text"> 所有参考文献 </span>

						<b class="arrow icon-angle-down"></b>
					</a>

					<ul class="submenu">
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								图书
								<b class="arrow icon-angle-down"></b>
							</a>
							<ul class="submenu">
								<li>
									<a href="Chinesebooks.html">
										<i class="icon-leaf"></i>
										中文图书
									</a>

								</li>
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										西文图书
									</a>

								</li>

							</ul>
						</li>

						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								期刊
								<b class="arrow icon-angle-down"></b>
							</a>
							<ul class="submenu">
								<li>
									<a href="Chinesejournals.html">
										<i class="icon-leaf"></i>
										中文期刊
									</a>

								</li>
								<li>
									<a href="Englishjournals.html">
										<i class="icon-leaf"></i>
										西文期刊
									</a>

								</li>

							</ul>
						</li>



						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								学位论文
								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu">
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										中文学位论文
									</a>

								</li>
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										西文学位论文
									</a>

								</li>

							</ul>

						</li>

						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>

								技术报告
								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu">
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										中文技术报告
									</a>
								</li>

								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-leaf"></i>

										西文技术报告

									</a>


								</li>
							</ul>
						</li>

						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								专利
								<b class="arrow icon-angle-down"></b>
							</a>
							<ul class="submenu">
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										中文专利
									</a>

								</li>
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										西文专利
									</a>

								</li>

							</ul>
						</li>
					</ul>
				</li>
				<li>
					<a href="#" class="dropdown-toggle">
						<i class="icon-book"></i>
						<span class="menu-text"> 期刊论文集 </span>

						<b class="arrow icon-angle-down"></b>
					</a>

					<ul class="submenu">
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								期刊
								<b class="arrow icon-angle-down"></b>
							</a>
							<ul class="submenu">
								<li class="active">
									<a href="journalAdd.html">
										<i class="icon-leaf"></i>
										中文期刊
									</a>

								</li>
								<li>
									<a href="journalAdd1.html">
										<i class="icon-leaf"></i>
										西文期刊
									</a>

								</li>

							</ul>
						</li>

						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-double-angle-right"></i>
								论文集
								<b class="arrow icon-angle-down"></b>
							</a>
							<ul class="submenu">
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										中文论文集
									</a>

								</li>
								<li>
									<a href="#">
										<i class="icon-leaf"></i>
										西文论文集
									</a>

								</li>

							</ul>
						</li>
					</ul>
				</li>
				<li class="active">
					<a href="#">
						<i class="icon-dashboard"></i>
						<span class="menu-text"> 参考文献分组 </span>
					</a>
				</li>
				<li>
					<a href="email2.html">
						<i class="glyphicon glyphicon-envelope"></i>
						<span class="menu-text"> Email系统 </span>
					</a>
				</li>
				<li>
					<a href="message2.html">
						<i class="glyphicon glyphicon-comment"></i>
						<span class="menu-text"> 短信系统 </span>
					</a>
				</li>
				<li>
					<a href="indeAdmin.html">
						<i class="glyphicon glyphicon-user"></i>
						<span class="menu-text"> 个人信息 </span>
					</a>
				</li>
				<li>
					<a href="index.html">
						<i class="glyphicon glyphicon-off"></i>
						<span class="menu-text"> 退出系统 </span>
					</a>
				</li>


			</ul>
			<!-- /.nav-list -->

			<div class="sidebar-collapse" id="sidebar-collapse">
				<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
			</div>

			<script type="text/javascript">
				try {
					ace.settings.check('sidebar', 'collapsed')
				} catch(e) {}
			</script>
		</div>

		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<script type="text/javascript">
					try {
						ace.settings.check('breadcrumbs', 'fixed')
					} catch(e) {}
				</script>

				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="#">主页</a>
					</li>

					<li class="active">参考文献分组</li>
				</ul>
				<!-- .breadcrumb -->

				<!-- #nav-search -->
			</div>

			<div class="page-content">

				<div class="row">
					<div class="col-xs-12">
						<div  class="btn-group row">
							<div class="col-md-11" style="">
								<button id="btn_add" type="button" class="btn btn-default">
									<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增个人分类
								</button>
							</div>

						</div>
						<!-- PAGE CONTENT BEGINS -->
						<div class="row">
							<div class="col-xs-3">
								<div class="tree well" style="margin-top:20px;">
<!--									<ul>-->
<!--										<li>-->
<!--											<span><i class="icon-folder-open"></i> Parent</span>-->
<!--											<ul>-->
<!--												<li>-->
<!--													<span><i class="icon-minus-sign"></i> Child</span>-->
<!--													<ul>-->
<!--														<li>-->
<!--															<span><i class="icon-leaf"></i> Grand Child</span>-->
<!--														</li>-->
<!--													</ul>-->
<!--												</li>-->
<!--												<li>-->
<!--													<span><i class="icon-minus-sign"></i> Child</span>-->
<!--													<ul>-->
<!--														<li>-->
<!--															<span><i class="icon-leaf"></i> Grand Child</span>-->
<!--														</li>-->
<!--														<li>-->
<!--															<span><i class="icon-minus-sign"></i> Grand Child</span>-->
<!--															<ul>-->
<!--																<li>-->
<!--																	<span><i class="icon-minus-sign"></i> Great Grand Child</span>-->
<!--																	<ul>-->
<!--																		<li>-->
<!--																			<span><i class="icon-leaf"></i> Great great Grand Child</span>-->
<!--																		</li>-->
<!--																		<li>-->
<!--																			<span><i class="icon-leaf"></i> Great great Grand Child</span>-->
<!--																		</li>-->
<!--																	</ul>-->
<!--																</li>-->
<!--																<li>-->
<!--																	<span><i class="icon-leaf"></i> Great Grand Child</span>-->
<!--																</li>-->
<!--																<li>-->
<!--																	<span><i class="icon-leaf"></i> Great Grand Child</span>-->
<!--																</li>-->
<!--															</ul>-->
<!--														</li>-->
<!--														<li>-->
<!--															<span><i class="icon-leaf"></i> Grand Child</span>-->
<!--														</li>-->
<!--													</ul>-->
<!--												</li>-->
<!--											</ul>-->
<!--										</li>-->
<!--										<li>-->
<!--											<span><i class="icon-folder-open"></i> Parent2</span>-->
<!--											<ul>-->
<!--												<li>-->
<!--													<span><i class="icon-leaf"></i> Child</span>-->
<!--												</li>-->
<!--											</ul>-->
<!--										</li>-->
<!--									</ul>-->
								</div>

							</div>
							<div class="col-xs-9" style="margin-top: -30px">
								<div class="table-responsive">
									<table style="text-overflow: ellipsis;white-space: nowrap;" id="sample-table-2">

									</table>

								</div>

							</div>
							<!--<div  class="col-xs-8">
							</div>-->
						</div>

						<!-- PAGE CONTENT ENDS -->
					</div>
					<!-- /.col -->
				</div>
				<!-- /.row -->
			</div>
			<!-- /.page-content -->
		</div>
		<!-- /.main-content -->

		<div class="ace-settings-container" id="ace-settings-container">
			<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
				<i class="icon-cog bigger-150"></i>
			</div>

			<div class="ace-settings-box" id="ace-settings-box">
				<div>
					<div class="pull-left">
						<select id="skin-colorpicker" class="hide">
							<option data-skin="default" value="#438EB9">#438EB9</option>
							<option data-skin="skin-1" value="#222A2D">#222A2D</option>
							<option data-skin="skin-2" value="#C6487E">#C6487E</option>
							<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
						</select>
					</div>
					<span>&nbsp; 换肤</span>
				</div>

				<div>
					<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
					<label class="lbl" for="ace-settings-add-container">
						居中
						<b></b>
					</label>
				</div>
			</div>
		</div>
		<!-- /#ace-settings-container -->
	</div>
	<!-- /.main-container-inner -->

	<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
		<i class="icon-double-angle-up icon-only bigger-110"></i>
	</a>

</div>
<div id="myModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
	<div class="modal-dialog modal-sm" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">警告</h4>
			</div>
			<div class="modal-body">
				<p>确定删除？</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-default confirm">确定</button>
			</div>
		</div>
	</div>
</div>

<div id="confirmAdd" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="confirmAddSmallModalLabel">
	<div class="modal-dialog modal-sm" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">确认</h4>
			</div>
			<div class="modal-body">
				<p>确定要添加这些文献吗？</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-default confirm">确定</button>
			</div>
		</div>
	</div>
</div>

<div id="tip" class="modal fade bs-example-modal-sm"  z-index="1" aria-labelledby="tipSmallModalLabel">
	<div class="modal-dialog modal-sm" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">警告</h4>
			</div>
			<div class="modal-body">
				<p>请至少选择一篇文献！</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default confirm">确定</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="add" tabindex="-" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel">新增个人分类</h4>
			</div>
			<div class="modal-body">

				<form>

					<form>
						<div class="form-group">
							<label>分类号：</label><span id="subsetNoNew"></span>
						</div>
						<div class="form-group">
							<label>分类名：</label>
							<input type="text" class="form-control" id="subsetTitle" placeholder="个人分类名">
						</div>

					</form>

				</form>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
				<button type="button" id="btn_submit" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel1">编辑</h4>
			</div>
			<div class="modal-body">

				<form>
					<div class="form-group">
						<label >分类号</label>
						<input type="text" class="form-control" id="subsetNo" placeholder="索引号">
					</div>
					<div class="form-group">
						<label >分类名</label>
						<input type="text" class="form-control" id="subsetTitle1" placeholder="个人分类名">
					</div>


				</form>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
				<button type="button" id="btn_submit1" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="addPaper" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document" style="width:800px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">所有文献</h4>
			</div>
			<div class="modal-body">

					<form>
						<form>
							<div class="table-responsive">
								<table style="text-overflow: ellipsis;white-space: nowrap;" id="tablePapers">

								</table>

							</div>

						</form>
					</form>
			</div>

			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
				<button type="button" id="addPapersToReference" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>添加到分组</button>
			</div>
		</div>
	</div>
</div>

<script src="../js/jquery-2.0.3.min.js"></script>
<script src="../js/jquery.cookie.js"></script>

<script type="text/javascript">
	if("ontouchend" in document) document.write("<script src='../js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-table.js"></script>
<script src="../js/bootstrap-editable.js"></script>
<script src="../js/bootstrap-table-zh-CN.js"></script>
<script src="../js/typeahead-bs2.min.js"></script>

<script src="../js/ace-elements.min.js"></script>
<script src="../js/ace.min.js"></script>
<script src="../js/mouseRight.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-confirm.min.js"></script>

<script>
	var userNo1 =""
	var idv = ""
	function queryCategory(){
		$.ajax({
			type : "Post",
			async:false,
			contentType : "application/json",
			dataType : 'json',
			url : '/ma/category/query',
			success : function(data) {
				var result = "<ul>"
				userNo1=data[0].userNo
				if(data.length==1&&data[0].subsetNo==null){

				}else{
					for(var i=0;i<data.length;i++){
						id = data[i].userNo+"-"+data[i].subsetNo+"-"+data[i].subsetTitle // onmousedown=\"mouseDown1("+id+")\"
						result +="<li><span id="+id+" ><i class=\"icon-leaf\"></i>"+"  "+data[i].subsetTitle+"</span></li>";
					}
				}
				result+="</ul>"
				$(".tree").append(result)

			}
		});
	}
	$(function(){
		queryCategory()
		mouseover()
		rightevent()
	})
	function  mouseover() {
		$('.tree span').mouseover(
				function(){
					idv = $(this).attr("id");
					console.log(idv)
				});
	}
	function  rightevent(){
		$('.tree span').mouseRight({
			menu: [
				{
					itemName: "查看文献",
					icon:"fa fa-clipboard",
					callback: function() {
						var id= idv
						array = id.split("-")
						userNo = array[0]
						subsetNo = array[1]
						subsetTitle = array[2]
						boot(userNo,subsetNo,subsetTitle)
					}
				},{
					itemName: "添加文献",
					icon:"fa fa-plus",
					callback: function() {
						var id= idv
						array = id.split("-")
						userNo = array[0]
						subsetNo = array[1]
						subsetTitle = array[2]
						$("#addPaper").modal()
						queryAllreference(userNo,subsetNo)
					}
				}, {
					itemName: "修改分组",
					icon:"fa fa-files-o",
					callback: function() {

					}
				},{
					itemName: "删除分组",
					icon:"fa fa-trash",
					callback: function() {
						$.confirm({
							title: "确认！",
							content: "确定要删除分组《"+subsetTitle+"》吗？",
							buttons: {
								ok: {
									text: '确认',
									btnClass: 'btn-primary',
									action: function () {
										$(".confirm").hide()
										var id= idv
										array = id.split("-")
										userNo = array[0]
										subsetNo = array[1]
										subsetTitle = array[2]
										$.ajax({
											type : "Post",
											data:JSON.stringify({
												"userNo":userNo,
												"subsetNo":subsetNo
											}),
											contentType : "application/json",
											dataType : 'json',
											url : '/ma/category/deleteCategory',
											success : function(data) {
												$('#sample-table-2').bootstrapTable('destroy');
												var id = userNo1+"-"+subsetNo+"-"+subsetTitle
												$("#"+id).remove()

											}
										});
									}
								},
								cancel: {
									text: '取消',
									btnClass: 'btn-primary',
									action: function () {
										// button action.
									}
								}
							}
						})
					}
				}]});
	}
	$("#btn_add").click(function() {
		$.ajax({
			type : "Post",
			contentType : "application/json",
			dataType : 'json',
			url : '/ma/category/getSubsetNoNew',
			success : function(data) {
				$('#subsetNoNew').text(data)
			}
		});
		$('#add').modal();
	})

	$(function(){
		$('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
		$('.tree li.parent_li > span').on('click', function (e) {
			console.log(e)
			var children = $(this).parent('li.parent_li').find(' > ul > li');
			if (children.is(":visible")) {
				children.hide('fast');
				$(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
			} else {
				children.show('fast');
				$(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
			}
			e.stopPropagation();
		});
	});

	$("#btn_submit").click(function() {
		var subsetNo = $("#subsetNoNew").text();
		var subsetTitle = $("#subsetTitle").val();
		$.ajax({
			type : "Post",
			contentType : "application/json;charset=utf-8",
			dataType : 'json',
			url : '/ma/category/addNewCategory',
			data:JSON.stringify({
				"subsetNo":subsetNo,
				"subsetTitle":subsetTitle
			}),
			success : function(data) {
				console.log(data.data)
				$.confirm({
					title: "确认！",
					content: data.data,
					buttons: {
						ok: {
							text: '确认',
							btnClass: 'btn-primary',
							action: function () {
								if(data.data =="success"){
									var id = userNo1+"-"+subsetNo+"-"+subsetTitle // onmousedown=\"mouseDown1("+id+")\"
									result ="<li><span id="+id+" ><i class=\"icon-leaf\"></i>"+"  "+subsetTitle+"</span></li>"
									$(".tree ul").append(result)
									mouseover()
									rightevent()
									$("#subsetTitle").val("");
								}

							}
						}
					}
				})
			}
		});
		$('#add').modal();
	});

	$("#addPapersToReference").click(function() {
		var a= $("#tablePapers").bootstrapTable("getSelections");
		console.log(a)
		if(a.length<=0){
			$.confirm({
				title: "提示!",
				content: "请至少选择一篇文献",
				confirm: function () {

				}
			});
		}else {
			var id= idv
			array = id.split("-")
			userNo = array[0]
			subsetNo = array[1]
			subsetTitle = array[2]
			$.confirm({
				title: "确认！",
				content: "确定要将这些文献添加到《"+subsetTitle+"》分组中吗？",
				buttons: {
					ok: {
						text: '确认',
						btnClass: 'btn-primary',
						action: function(){

							var subsets=new Array()//声明为一个对象,这是一个数组对象
							for (var i = 0; i <a.length ; i++) {
								var subsetIndex= new Object();
								subsetIndex.userNo = userNo;
								subsetIndex.subsetNo = subsetNo;
								subsetIndex.indexNo = a[i].indexNo;
								subsetIndex.subsetTitle = null;
								subsetIndex.subsetDate = null;
								subsets.push(subsetIndex);
							}
							$.ajax({
								type: "post",
								url: "../category/addPapersToGroup",
								contentType:"application/json",
								dataType: "json",
								data: JSON.stringify(subsets),
								success: function (data) {
									$("#addPaper").modal('hide')
								}
							});
						}
					},
					cancel: {
						text: '取消',
						btnClass: 'btn-primary',
						action: function(){
							// button action.
						}
					}
				}
			})
		}
	})


</script>
<script>
	function boot(userNo,subsetNo,subsetTitle){
		$('#sample-table-2').bootstrapTable('destroy');
		$('#sample-table-2').bootstrapTable({
			url: '/ma/category/queryBySet',
			contentType : 'application/x-www-form-urlencoded; charset=UTF-8',
			queryParams : function(params) {
				return {
					userNo : userNo,
					subsetNo:subsetNo
				};
			},
			method: 'POST', //请求方式（*）
			toolbar: '#toolbar', //工具按钮用哪个容器
			striped: true, //是否显示行间隔色
			cache: false, //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
			pagination: true, //是否显示分页（*）
			sortable: true, //是否启用排序
			sortOrder: "desc", //排序方式
			sidePagination: "client", //分页方式：client客户端分页，server服务端分页（*）
			pageNumber: 1, //初始化加载第一页，默认第一页
			pageSize: 10, //每页的记录行数（*）
			pageList: [10, 25, 50, 100], //可供选择的每页的行数（*）
			search: true, //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
			strictSearch: false,
			showColumns: true, //是否显示所有的列
			showRefresh: true, //是否显示刷新按钮
			minimumCountColumns: 2, //最少允许的列数
			clickToSelect: true, //是否启用点击选中行
			//height: 500, //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
			uniqueId: "indexNo", //每一行的唯一标识，一般为主键列
			showToggle: true, //是否显示详细视图和列表视图的切换按钮
			cardView: false, //是否显示详细视图
			detailView: false,
			editable: true,
			toolbarAlign: "left",
			rowStyle: function(row, index) {
				//这里有5个取值代表5中颜色['active', 'success', 'info', 'warning', 'danger'];
				var strclass = "";
				if(row.ORDER_STATUS == "待排产") {
					strclass = 'success'; //还有一个active
				} else if(row.ORDER_STATUS == "已删除") {
					strclass = 'danger';
				} else {
					return {};
				}
				return {
					classes: strclass
				}
			},
			columns: [{
				field: 'indexNo',
				title: '索引号',
				align: 'center',
				sortable: true
			}, {
				field: 'item',
				title: '文献条目',
				align: 'center',
				sortable: true
			}, {
				field: 'indexCode',
				title: '文献类型',
				align: 'center',
				sortable: true

			}, {
				field: 'stamp',
				title: '最后修改时间',
				align: 'center',
				editable: true,
				sortable: true
			}, {
				title: '操作',
				field: 'id',
				align: 'center',
				formatter: function(value, row, index) {
					// var e = '<a class = "edit" href="#" mce_href="#"><i class="icon-pencil bigger-130"></i></i></a> ';
					var d = '<a class = "remove" href="#" mce_href="#" ><i class="icon-trash bigger-130"></i></a> ';
					return  d;
				},
				events: 'operateEvents'
			}]

		});

		window.operateEvents = {
			'click .edit': function(e, value, row, index) {
				/*$.cookie('teamNo', row.teamNo);
                window.location.href = 'teamedit.html';*/
				// $("#cityID").val(row.cityID);
				// $("#region").val(row.region);
				// $("#stateName2").val(row.stateName2);
				// $("#stateName1").val(row.stateName1);
				// $("#stateAbbr").val(row.stateAbbr);
				// $("#cityName2").val(row.cityName2)
				// $("#cityName1").val(row.cityName1);
				$('#edit').modal();

			},
			'click .remove': function(e, value, row, index) {
				/*$("#myModal .confirm").attr("onclick","confirmRemove("+row.teamNo+");");*/
				//$('#myModal').modal();
				data ="确定要将["+row.indexNo+"]从《"+subsetTitle+"》分类中删除吗？"
				$.confirm({
					title: "确认！",
					content: data,
					buttons: {
						ok: {
							text: '确认',
							btnClass: 'btn-primary',
							action: function () {
								$.ajax({
									type: "POST",
									contentType: "application/json",
									data: '{"indexNo":"' + row.indexNo + '","subsetNo":"' + subsetNo+'" }',
									dataType: 'json',
									url: '/ma/category/deletePaperFromGroup',
									success: function(data) {
										$('#sample-table-2').bootstrapTable('remove', {
											field: 'indexNo',
											values: [row.indexNo]
										});
									}
								});
							},
							cancel: {
								text: '取消',
								btnClass: 'btn-primary',
								action: function () {
									// button action.
								}
							}
						}
					}
				})


			}

		};
	}

	function  queryAllreference(userNo,subsetNo) {
		$('#tablePapers').bootstrapTable('destroy');
		$('#tablePapers').bootstrapTable({
			url: '/ma/category/queryAllreference',
			contentType : 'application/x-www-form-urlencoded; charset=UTF-8',
			queryParams : function(params) {
				return {
					userNo : userNo,
					subsetNo:subsetNo
				};
			},
			method: 'POST', //请求方式（*）
			toolbar: '#toolbar', //工具按钮用哪个容器
			striped: true, //是否显示行间隔色
			cache: false, //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
			pagination: true, //是否显示分页（*）
			sortable: true, //是否启用排序
			sortOrder: "desc", //排序方式
			sidePagination: "client", //分页方式：client客户端分页，server服务端分页（*）
			pageNumber: 1, //初始化加载第一页，默认第一页
			pageSize: 10, //每页的记录行数（*）
			pageList: [10, 25, 50, 100], //可供选择的每页的行数（*）
			search: true, //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
			strictSearch: false,
			showColumns: true, //是否显示所有的列
			showRefresh: true, //是否显示刷新按钮
			minimumCountColumns: 2, //最少允许的列数
			clickToSelect: true, //是否启用点击选中行
			//height: 500, //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
			uniqueId: "indexNo", //每一行的唯一标识，一般为主键列
			showToggle: true, //是否显示详细视图和列表视图的切换按钮
			cardView: false, //是否显示详细视图
			detailView: false,
			editable: true,
			toolbarAlign: "left",
			rowStyle: function(row, index) {
				//这里有5个取值代表5中颜色['active', 'success', 'info', 'warning', 'danger'];
				var strclass = "";
				if(row.ORDER_STATUS == "待排产") {
					strclass = 'success'; //还有一个active
				} else if(row.ORDER_STATUS == "已删除") {
					strclass = 'danger';
				} else {
					return {};
				}
				return {
					classes: strclass
				}
			},
			columns: [{
				checkbox: true
			},{
				field: 'indexNo',
				title: '索引号',
				align: 'center',
				sortable: true
			}, {
				field: 'item',
				title: '文献条目',
				align: 'center',
				sortable: true
			}, {
				field: 'indexCode',
				title: '文献类型',
				align: 'center',
				sortable: true

			}, {
				field: 'stamp',
				title: '最后修改时间',
				align: 'center',
				editable: true,
				sortable: true
			}]

		});
	}

</script>

</body>

</html>